package Prototype;

public class PrototypeCitation {
    public static void main(String[] args) throws CloneNotSupportedException{
        citation c1 = new citation("loong","************","rjxy");
        c1.display();
        citation c2 = (citation)c1.clone();
        c2.setName("hdy");
        c2.display();
    }
}
//奖状类
class citation implements Cloneable{
    String name;
    String info;
    String college;
    citation(String name,String info,String college){
        this.name = name;
        this.info = info;
        this.college = college;
        System.out.println("奖状创建成功!");
    }
    void setName(String name){
        this.name = name;
    }
    String getName(){
        return this.name;
    }
    void display(){
        System.out.println(name+info+college);
    }
    public Object clone() throws CloneNotSupportedException{
        System.out.println("拷贝奖状成功！");
        return (citation)super.clone();
    }
}
